package com.solcoo.customer;

import com.android.common.App;
import com.android.common.util.StringUtil;

public class Constant {

	public static class IntentKey {
		public static final String SHOP_NO = "shopNo";
	}

	public static class URL {

		public static final String BASE_URL = "http://42.120.7.37/Solcoo/";

		private static final int USER_TYPE = 2;

		public static String appendBaseInfo(StringBuilder u) {
			return u.append("&v=")
					.append(StringUtil.encode("android_" + App.System.VERSION))
					.toString();
		}

		public static String getReg(String phoneNo, String pwd) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("signup.do?");
			u.append("shoujih=").append(phoneNo);
			u.append("&mima=").append(pwd);
			u.append("&leixing=").append(USER_TYPE);
			return appendBaseInfo(u);
		}

		public static String getCheckCode(String phoneNo) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("check.do?");
			u.append("shoujih=").append(phoneNo);
			return appendBaseInfo(u);
		}

		public static String getLogin(String name, String pwd) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("login.do?");
			u.append("yonghum=").append(name);
			u.append("&mima=").append(pwd);
			u.append("&leixing=").append(USER_TYPE);
			return appendBaseInfo(u);
		}

		public static String getEdit(String editKey, String editValue,
				String cardNo) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("update.do?");
			u.append("yonghum=").append(cardNo);
			u.append("&").append(editKey).append("=")
					.append(StringUtil.encode(editValue));
			return appendBaseInfo(u);
		}

		public static String getHeadEdit(String cardNo) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("updatePic.do?");
			u.append("yonghum=").append(cardNo);
			return appendBaseInfo(u);
		}

		public static String getFind() {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("grQueryShs.do");
			return appendBaseInfo(u);
		}

		public static String getCardList(String cardNo, long cursor) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("grQueryHysh.do?");
			u.append("gerenid=").append(cardNo);
			u.append("&youbiao=").append(cursor);
			return appendBaseInfo(u);
		}

		public static String getShopDetail(String cardNo, String shopNo) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("grQuerySh.do?");
			u.append("gerenid=").append(cardNo);
			u.append("&shanghuid=").append(shopNo);
			return appendBaseInfo(u);
		}

		public static String getOrderList(String cardNo, String shopNo,
				long cursor) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("grQueryDd.do?");
			u.append("gerenid=").append(cardNo);
			u.append("&shanghuid=").append(shopNo);
			u.append("&youbiao=").append(cursor);
			return appendBaseInfo(u);
		}

		public static String getLevel(String shopNo) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("shQueryDz.do?");
			u.append("shanghuid=").append(shopNo);
			return appendBaseInfo(u);
		}

		public static String getFollow(String cardNo, String shopNo) {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("grAddGz.do?");
			u.append("gerenid=").append(cardNo);
			u.append("&shanghuid=").append(shopNo);
			u.append("&shifougz=").append(1);
			return appendBaseInfo(u);
		}

		public static String getVersion() {
			StringBuilder u = new StringBuilder(BASE_URL);
			u.append("version.do?");
			u.append("version=").append(App.System.VERSION);
			u.append("&leixing=").append(USER_TYPE);
			return appendBaseInfo(u);
		}
	}

	public static class SharedKey {
		public static final String USER = "SHAREDKEY_USER";
		public static final String UPDATE_TIME = "SHAREDKEY_UPDATE_SHOW_TIME";
	}
}
